package com.cdp.web.controller.system;

import com.cdp.common.core.domain.AjaxResult;
import com.cdp.common.core.domain.entity.SysStatistics;
import com.cdp.system.dto.SysStatisticsDTO;
import com.cdp.system.service.ISysStatisticsService;
import com.cdp.system.vo.SysStatisticsVO;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 统计分析
 */
@RestController
@RequestMapping
public class SysStatisticsController {


    @Autowired
    private ISysStatisticsService sysStatisticsService;


    @PostMapping("list/statistics")
    private AjaxResult querySysStatistic(@RequestBody SysStatisticsDTO sysStatisticsDTO) {
        return AjaxResult.success(sysStatisticsService.querySysStatistic(sysStatisticsDTO));
    }



    /**
     * 增加统计
     * @param statistics
     * @return
     */
    @PostMapping("add/statistics")
    public AjaxResult addStatistic(@RequestBody SysStatisticsDTO statistics) {
        // 调用 Service 层的 addStatistic 方法来处理添加逻辑
        return sysStatisticsService.addStatistic(statistics);

    }





}
